home *** CD-ROM | disk | FTP | other *** search
- /*******************************************************************************
- * Copyright © 1992-1993 Mark Pilgrim *
- * *
- * This file is provided as is, and may be freely distributed unaltered. This *
- * message must accompany any copy of this file. This file may be used or *
- * modified for use for a non-commercial product provided that appropriate *
- * credit is given to the author named above. *
- * Commercial use of this source code is prohibited. *
- ******************************************************************************/
-
- #include "msg misc.h"
- #include "msg timing.h"
-
- #define gap 7
- #define CorrectTime 2
-
- void CircleSerendipity(GrafPtr);
-
- /* I haven't the slightest idea why this works. Hence the name. -MP */
-
- void CircleSerendipity(GrafPtr sourceGrafPtr)
- {
- Rect theRect;
- Rect source;
- RgnHandle curregion;
- Point zeropoint;
-
- source.top=source.left=0;
- source.right=MAIN_WINDOW_WIDTH;
- source.bottom=MAIN_WINDOW_HEIGHT;
-
- theRect=source;
- theRect.top-=MAIN_WINDOW_HEIGHT;
- OffsetRect(&theRect,0,-MAIN_WINDOW_HEIGHT);
-
- curregion=NewRgn();
- SetEmptyRgn(curregion);
- OpenRgn();
- FrameOval(&theRect);
- CloseRgn(curregion);
- zeropoint.v=MAIN_WINDOW_HEIGHT;
- zeropoint.h=0;
- do
- {
- StartTiming();
- CopyBits(&(sourceGrafPtr->portBits), &(gMainWindow->portBits),
- &source, &source, 0, curregion);
- OffsetRgn(curregion, 0, gap);
- TimeCorrection(CorrectTime);
- }
- while (!(PtInRgn(zeropoint, curregion)));
-
- CopyBits(&(sourceGrafPtr->portBits), &(gMainWindow->portBits),
- &source, &source, 0, 0L);
-
- DisposeRgn(curregion);
- }
-